import { createRouter, createWebHistory } from 'vue-router'
import Home from "@/views/HomeView.vue";

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/customers',
    name: 'customers',
    component: () => import('../views/customer/CustomerList.vue')
  },
  {
    path: '/customers/add',
    name: 'addCustomer',
    component: () => import('../views/customer/AddCustomer.vue')
  },
  {
    path: '/customers/:id',
    name: 'customerDetail',
    component: () => import('../views/customer/CustomerDetail.vue')
  },
  {
    path: '/accounts',
    name: 'accounts',
    component: () => import('../views/account/AccountList.vue')
  },
  {
    path: '/accounts/add',
    name: 'addAccount',
    component: () => import('../views/account/AddAccount.vue')
  },
  {
    path: '/accounts/:id/transactions',
    name: 'accountTransactions',
    component: () => import('../views/account/AccountTransactions.vue')
  },
  {
    path: '/transactions',
    name: 'transactions',
    component: () => import('../views/transaction/TransactionList.vue')
  },
  {
    path: '/transactions/deposit',
    name: 'deposit',
    component: () => import('../views/transaction/Deposit.vue')
  },
  {
    path: '/transactions/withdraw',
    name: 'withdraw',
    component: () => import('../views/transaction/Withdraw.vue')
  },
  {
    path: '/transactions/transfer',
    name: 'transfer',
    component: () => import('../views/transaction/Transfer.vue')
  },
  {
    path: '/transactions/:id',
    name: 'transactionDetail',
    component: () => import('../views/transaction/TransactionDetail.vue')
  }
]

const router = createRouter({
  history: createWebHistory('/'),  // 使用 HTML5 History 模式，并设置基础路径为 '/'
  routes
})

export default router